6. 極座標と極方程式#
6.1. 準備#
6.1.1. 授業資料#
Show code cell source
# おまじない。1度実行しましょう。
!pip install japanize-matplotlib
Show code cell output
Collecting japanize-matplotlib
Downloading japanize-matplotlib-1.1.3.tar.gz (4.1 MB)
?25l ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 0.0/4.1 MB ? eta -:--:--
━━━━━╺━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 0.6/4.1 MB 17.5 MB/s eta 0:00:01
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╸ 4.1/4.1 MB 66.2 MB/s eta 0:00:01
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 4.1/4.1 MB 46.0 MB/s eta 0:00:00
?25h Preparing metadata (setup.py) ... ?25l?25hdone
Requirement already satisfied: matplotlib in /usr/local/lib/python3.10/dist-packages (from japanize-matplotlib) (3.8.0)
Requirement already satisfied: contourpy>=1.0.1 in /usr/local/lib/python3.10/dist-packages (from matplotlib->japanize-matplotlib) (1.3.1)
Requirement already satisfied: cycler>=0.10 in /usr/local/lib/python3.10/dist-packages (from matplotlib->japanize-matplotlib) (0.12.1)
Requirement already satisfied: fonttools>=4.22.0 in /usr/local/lib/python3.10/dist-packages (from matplotlib->japanize-matplotlib) (4.55.3)
Requirement already satisfied: kiwisolver>=1.0.1 in /usr/local/lib/python3.10/dist-packages (from matplotlib->japanize-matplotlib) (1.4.7)
Requirement already satisfied: numpy<2,>=1.21 in /usr/local/lib/python3.10/dist-packages (from matplotlib->japanize-matplotlib) (1.26.4)
Requirement already satisfied: packaging>=20.0 in /usr/local/lib/python3.10/dist-packages (from matplotlib->japanize-matplotlib) (24.2)
Requirement already satisfied: pillow>=6.2.0 in /usr/local/lib/python3.10/dist-packages (from matplotlib->japanize-matplotlib) (11.0.0)
Requirement already satisfied: pyparsing>=2.3.1 in /usr/local/lib/python3.10/dist-packages (from matplotlib->japanize-matplotlib) (3.2.0)
Requirement already satisfied: python-dateutil>=2.7 in /usr/local/lib/python3.10/dist-packages (from matplotlib->japanize-matplotlib) (2.8.2)
Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.10/dist-packages (from python-dateutil>=2.7->matplotlib->japanize-matplotlib) (1.17.0)
Building wheels for collected packages: japanize-matplotlib
Building wheel for japanize-matplotlib (setup.py) ... ?25l?25hdone
Created wheel for japanize-matplotlib: filename=japanize_matplotlib-1.1.3-py3-none-any.whl size=4120257 sha256=7a20ff4023601ce8b9e799b4dfc4d395aca3f208d051e68031c616cd324275cd
Stored in directory: /root/.cache/pip/wheels/61/7a/6b/df1f79be9c59862525070e157e62b08eab8ece27c1b68fbb94
Successfully built japanize-matplotlib
Installing collected packages: japanize-matplotlib
Successfully installed japanize-matplotlib-1.1.3
Show code cell source
# おまじない。1度実行しましょう
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.collections
import matplotlib.animation
import matplotlib.colors
import japanize_matplotlib
import math
from IPython.display import HTML
# おまじないその2
## 曲座標→デカルト座標
def coordinate(r, theta):
x = r * np.cos(theta)
y = r * np.sin(theta)
return x, y
def draw_steps(ax, artist_prev, r, theta):
artist = []
x, y = coordinate(r, theta)
artist_prev.extend(ax.plot(x, y, 'ro'))
artist.extend(artist_prev)
artist.extend(ax.plot([0, x], [0, y], color='blue', linestyle='--'))
artist.append(ax.text(x, y, r"$r = {:.2f}$".format(abs(r)) + "\n"+ r"$\theta = {:.2f}$".format(theta), ha='right'))
return artist
def draw_finish(ax, artist_prev, X, Y, pole = '極'):
ax.plot(0,0, 'o', color = 'b')
ax.text(0,0.01, pole)
ax.set_xlabel('$x$')
ax.set_ylabel('$y$')
ax.grid()
artist = []
artist.extend(artist_prev)
artist.extend(ax.plot(X, Y, color='blue'))
return artist
6.2. 復習/媒介変数表示#
6.2.1. 例/サイクロイド#
サイクロイドの媒介変数表示は次のようになっていました。
これを\(\theta\)の変化がわかるように描くと次の図のようになります。
Show code cell source
# aの値
a = 0.5
## 描画の細かさ (θの幅指定。細かくしたければここの値を小さくすれば良いです)
stp = 0.2
# 極方程式
def f(x):
return a * (x - np.sin(x)), a * (1 - np.cos(x))
# 円描画用theta
stp_line = 0.00001
circ_x, circ_y = coordinate(a, np.arange(0, 2 * np.pi, stp_line))
circ_y = circ_y + a
# サイクロイドアニメーション用
def step_cycloid(ax, artist_prev, theta):
artist = []
x, y = f(theta)
artist_prev.extend(ax.plot(x, y, 'ro', alpha = 0.4))
cx = circ_x + a * theta
cy = circ_y
c_center_x, c_center_y = a * theta, a
artist.extend(artist_prev)
artist.extend(ax.plot(c_center_x , c_center_y ,'ro' , alpha = 0.6))
artist.extend(ax.plot(cx, cy, color='blue', alpha = 0.5))
artist.append(ax.arrow(c_center_x, c_center_y, -a * np.sin(theta), -a * np.cos(theta), head_width=0.1, head_length=0.1,ec='green'))
artist.append(ax.text(c_center_x, c_center_y, r"$\theta = {:.2f}$".format(theta), ha='right', color='black'))
return artist
theta = np.arange(0, 3 * np.pi, stp_line)
thetas = np.arange(0, 3 * np.pi, stp)
# base figure
X,Y = f(theta)
fig, ax = plt.subplots()
ax.set_aspect('equal')
# animation drawing section
artists = []
artist_prev = []
for t in thetas:
artists.append(step_cycloid(ax, artist_prev, t))
artists.append(draw_finish(ax, artist_prev, X, Y, pole='O'))
ani = matplotlib.animation.ArtistAnimation(fig, artists, interval=500)
html = ani.to_jshtml(default_mode='once')
plt.close(fig)
# ani.save('cycloid.gif')
HTML(html)
6.3. 極方程式#
今までは、直交座標系と呼ばれる、いわゆる\(x\)軸と\(y\)軸からなる座標系で考えてきましたが、複素数でもみた極形式が複素数平面上(\(\mathbb{C}\))のある点からの
距離
角度
によって座標を表すことができました。 それを普通の平面上(\(\mathbb{R}^2\))で考えたものが極座標です。
さらに、その複素数平面上の曲線の方程式が極形式で表されたように、それを極座標で表したものが極方程式になります。
定義/極方程式
平面上の曲線\(C\)が極座標\((r, \theta)\)によって、
\(r=f(\theta)\)
\(F(r,\theta)=0\) (\(r\)と\(\theta\)の式\(= 0\))
のいずれかで書かれるとき、この方程式を曲線\(C\)の極方程式という。
極方程式では、
図形のイメージを掴む
複数の点をプロットすることによって概形を描けるようになる
ことが習得の鍵になるでしょう。
では実際の例を見てみましょう。
6.3.1. 極を通る直線#
動径方向となす角が一定な直線上の点の軌跡と見ることができるので、
になります。
6.3.2. 円#
極方程式
は極を中心とする円を表します。
円は極からの距離が等しい点の軌跡と見ることができるので、直感的にも、わかりやすいのではないでしょうか。 半径が一定で、角度は任意、そんな図形は確かに円です。
Show code cell source
# 半径
radius = 2
# 描画の細かさ
stp = 0.1
stp_line = 0.00001
max_range = 2 * np.pi
theta = np.arange(0, max_range, stp_line)
thetas = np.arange(0, max_range, stp)
def f(x):
return radius
# base figure
X,Y = coordinate(f(theta), theta)
fig, ax = plt.subplots()
ax.set_aspect('equal')
# animation drawing section
artists = []
artist_prev = []
for t in thetas:
artists.append(draw_steps(ax,artist_prev, f(t), t))
artists.append(draw_finish(ax, artist_prev, X, Y))
ani = matplotlib.animation.ArtistAnimation(fig, artists, interval=500)
html = ani.to_jshtml(default_mode = 'once')
plt.close(fig)
HTML(html)
6.3.3. アルキメデスの螺旋#
極方程式
で表される曲線はアルキメデスの螺旋と呼ばれます。では、実際に描いてみたいと思います。
Show code cell source
# αの値
alpha = 1
# 描画の細かさ
stp = 0.2
stp_line = 0.00001
max_range = 6 * np.pi
theta = np.arange(0, max_range, stp_line)
thetas = np.arange(0, max_range, stp)
def f(x):
return a * x
# base figure
X,Y = coordinate(f(theta), theta)
fig, ax = plt.subplots()
# animation drawing section
artists = []
artist_prev = []
for t in thetas:
artists.append(draw_steps(ax,artist_prev, f(t), t))
artists.append(draw_finish(ax, artist_prev, X, Y))
ani = matplotlib.animation.ArtistAnimation(fig, artists, interval=500)
html = ani.to_jshtml(default_mode = 'once')
plt.close(fig)
HTML(html)
check
上の図において極方程式の\(\alpha\)の値を変更して、図形がどのように変化するか確認してみよう。
6.3.4. カージオイド#
カージオイドの極方程式は
と表されます。
以下では、\(r=a(1+\cos \theta)\)として描いています。これも\(a\)の値や\(\pm\)を変えて図形の変化を見てみましょう。
\(r=a(1-\cos \theta )\)または\(r=a(1-\sin \theta )\)にする場合\(\to\)
is_positive=0と指定\(r=a(1\pm \cos \theta)\)にする場合\(\to\)
is_cos = 1と指定
するようにしてください。
Show code cell source
a = 1
# ±のうち+なら1, -なら0
is_positive = 1
# 上の式のcosの方なら1, sinの方なら0
is_cos = 1
# 描画の細かさ
stp = 0.1
stp_line = 0.00001
max_range = 2 * np.pi
theta = np.arange(0, max_range, stp_line)
thetas = np.arange(0, max_range, stp)
def f(x):
return a * (1 + (np.cos(x) if is_cos else np.sin(x))) * (1 if is_positive else -1)
# base figure
X,Y = coordinate(f(theta), theta)
fig, ax = plt.subplots()
# animation drawing section
artists = []
artist_prev = []
for t in thetas:
artists.append(draw_steps(ax,artist_prev, f(t), t))
artists.append(draw_finish(ax, artist_prev, X, Y))
ani = matplotlib.animation.ArtistAnimation(fig, artists, interval=500)
html = ani.to_jshtml(default_mode = 'once')
plt.close(fig)
HTML(html)
check
上の図において極方程式の\(a,b\)の値を変更して、曲線がどのように変化するか確認してみよう。
6.3.5. レムニスケート#
レムニスケートは
で表されます。こう書かれるとどんな図形か全くわからないので、とりあえず描いてみます。
Show code cell source
a = 1
stp = 0.1
stp_line = 0.00001
max_range = 2 * np.pi
theta = np.arange(0, np.pi / 4, stp_line)
theta = np.concatenate([theta, np.arange(3*np.pi / 4, 5*np.pi/4, stp_line)])
theta = np.concatenate([theta, np.arange(7*np.pi / 4, 2*np.pi, stp_line)])
thetas = np.arange(0, np.pi / 4, stp)
thetas = np.concatenate([thetas, np.arange(3*np.pi / 4, 5*np.pi/4, stp)])
thetas = np.concatenate([thetas, np.arange(7*np.pi / 4, 2*np.pi, stp)])
def f(x):
return (a **2) * abs(np.cos(2 * x))
# base figure
X,Y = coordinate(f(theta), theta)
fig, ax = plt.subplots()
# animation drawing section
artists = []
artist_prev = []
for t in thetas:
artists.append(draw_steps(ax,artist_prev, f(t), t))
artists.append(draw_finish(ax, artist_prev, X, Y))
ani = matplotlib.animation.ArtistAnimation(fig, artists, interval=500)
html = ani.to_jshtml(default_mode = 'once')
plt.close(fig)
HTML(html)
6.3.6. 蜘蛛の巣#
極方程式
で表される曲線は蜘蛛の巣になります。
\(a\)や\(b\), \(n\)の値を変えてみると、いろいろな形に変化します。
Show code cell source
a = 10
b = 9
n = 9
# 描画の細かさ
stp = 0.1
# 描画スタートのθ
min_range = 0
# 描画終了のθ
max_range = 2 * np.pi
stp_line = 0.00001
theta = np.arange(min_range, max_range, stp_line)
thetas = np.arange(min_range, max_range, stp)
def f(a, b, x, n):
return a * (np.cos(n * x) ** 2) + b * (np.sin(n * x) ** 2)
# base figure
X,Y = coordinate(f(a, b, theta, n), theta)
# base figure
X,Y = coordinate(f(a, b, n, theta), theta)
fig, ax = plt.subplots()
# animation drawing section
artists = []
artist_prev = []
for t in thetas:
artists.append(draw_steps(ax,artist_prev, f(a,b,n,t), t))
artists.append(draw_finish(ax, artist_prev, X, Y))
ani = matplotlib.animation.ArtistAnimation(fig, artists, interval=500)
html = ani.to_jshtml(default_mode = 'once')
plt.close(fig)
HTML(html)
6.3.7. 二次曲線の極方程式#
二次曲線\(C\)の焦点を極とする極座標において、\(C\)の極方程式は
です。ここで\(e\)は離心率と呼ばれ、
\(0<e<1 \to\) 楕円
\(e=1\to\) 放物線
\(e > 1 \to\) 双曲線
になります。
では実際に図で表すとどんな感じになるか見てみましょう。
Caution
\(e\geqq 1\)の時、つまり双曲線、放物線の場合には一部の点が発散してしまうので、\(\frac{\pi}{4}\leqq \theta \leqq \frac{7\pi}{4}\)で表示しています。
以下では、
で描画しています。
Show code cell source
# aの値と離心率(いろいろ変更してどのように変化するか見てみよう!)
a = 0.5
e = 0.8
## 描画の細かさ (θの幅指定。細かくしたければここの値を小さくすれば良いです)
stp = 0.1
# 極方程式
def f(x):
return a / (1 - e * np.cos(x))
stp_line = 0.00001
# 双曲線は発散するから描画範囲を限定している
if e >= 1:
theta = np.arange(np.pi/4, 7 * np.pi / 4, stp_line)
thetas = np.arange(np.pi/4, 7 * np.pi / 4, stp)
r = a / (1 - e * np.cos(theta))
hyp = 1
else:
theta = np.arange(0, 2 * np.pi, stp_line)
thetas = np.arange(0, 2 * np.pi, stp)
# base figure
X,Y = coordinate(f(theta), theta)
fig, ax = plt.subplots()
# animation drawing section
artists = []
artist_prev = []
for t in thetas:
artists.append(draw_steps(ax,artist_prev, f(t), t))
artists.append(draw_finish(ax, artist_prev, X, Y, '焦点'))
ani = matplotlib.animation.ArtistAnimation(fig, artists, interval=500)
html = ani.to_jshtml(default_mode='once')
# ani.save('quadric.gif')
plt.close(fig)
HTML(html)
6.4. 演習問題#
では、極方程式が与えられた時に、どのような図形になるか、実際に自分の手で描いてみましょう。
描いてみたら、解答と見比べ、さらにパラメータを変更してどのような変化があるか、考察してみましょう。
6.4.1. 正葉曲線#
極方程式
で表される曲線の概形を、次の表を利用して描きなさい。
\(\theta\) |
\(0\) |
\(\frac{\pi}{6}\) |
\(\frac{\pi}{4}\) |
\(\frac{\pi}{3}\) |
\(\frac{\pi}{2}\) |
\(\frac{2\pi}{3}\) |
\(\frac{3\pi}{4}\) |
\(\frac{5\pi}{6}\) |
|---|---|---|---|---|---|---|---|---|
\(r\) |
||||||||
\(\theta\) |
\(\pi\) |
\(\frac{7\pi}{6}\) |
\(\frac{5\pi}{4}\) |
\(\frac{4\pi}{3}\) |
\(\frac{3\pi}{2}\) |
\(\frac{5\pi}{3}\) |
\(\frac{7\pi}{4}\) |
\(\frac{11\pi}{6}\) |
\(r\) |
解答.
Show code cell source
# 各値の指定
a = 1
n = 2
# r = a cos nθにするかどうかの指定。is_cos = 1ならr = a cos nθになる。
is_cos = 0
# アニメーションの細かさ
stp = 0.2
stp_line = 0.00001
theta = np.arange(0, 2 * np.pi, stp_line)
thetas = np.arange(0, 2 * np.pi, stp)
def f(x):
return a * (np.cos(n*x) if is_cos else np.sin(n * x))
# base figure
X,Y = coordinate(f(theta), theta)
fig, ax = plt.subplots()
# animation drawing section
artists = []
artist_prev = []
for t in thetas:
artists.append(draw_steps(ax,artist_prev, f(t), t))
artists.append(draw_finish(ax, artist_prev, X, Y))
ani = matplotlib.animation.ArtistAnimation(fig, artists, interval=500)
html = ani.to_jshtml(default_mode = 'once')
plt.close(fig)
HTML(html)
Show code cell output
発展問題
極方程式
で表される図形において、\(a\)や\(n\)の値、\(\sin\)や\(\cos\)を変更すると、曲線の概形はどのように変化するだろうか。考察し自分で概形を描いたのちに、以下のコードを実行してみなさい。
解答コードに関する注意
解答に関する説明
解答はデフォルトで\(r=\sin 2 \theta\)ですが、コード中のa = 1やn = 2, is_cos = 0, is_cos = 1に変更してどんな図形になるか観察してみましょう。
その際、
is_cos = 0ならば\(r = a \sin n \theta\)is_cos = 1ならば\(r = a \cos n \theta\)
を表しています(a,nは式の中の文字と同じ)。
解答.
Show code cell source
# 各値の指定
a = 2
n = 2
# r = a cos nθにするかどうかの指定。is_cos = 1ならr = a cos nθになる。
is_cos = 1
# アニメーションの細かさ
stp = 0.2
stp_line = 0.00001
theta = np.arange(0, 2 * np.pi, stp_line)
thetas = np.arange(0, 2 * np.pi, stp)
def f(x):
return a * (np.cos(n*x) if is_cos else np.sin(n * x))
# base figure
X,Y = coordinate(f(theta), theta)
fig, ax = plt.subplots()
# animation drawing section
artists = []
artist_prev = []
for t in thetas:
artists.append(draw_steps(ax,artist_prev, f(t), t))
artists.append(draw_finish(ax, artist_prev, X, Y))
ani = matplotlib.animation.ArtistAnimation(fig, artists, interval=500)
html = ani.to_jshtml(default_mode = 'once')
plt.close(fig)
HTML(html)
Show code cell output
解説.
極方程式
の形で表される曲線を正葉曲線といいます。 ここまでは暗黙のうちに、\(n\)は1以上の整数としてきましたが、実際のところ\(n\)が有理数なら図形が描けます。 上のコードで値を変更して、試してみましょう。
超絶余談ですが、英語だとRose Curveというそう。ということは「バラ=正葉」ということか!?
6.4.2. リマソン(パスカルの蝸牛)#
極方程式
で表される曲線の概形を描きなさい。
解答.
Show code cell source
# 各値の指定
a = 1
b = 2
# アニメーションの細かさ
stp = 0.2
stp_line = 0.00001
theta = np.arange(0, 2 * np.pi, stp_line)
thetas = np.arange(0, 2 * np.pi, stp)
def f(x):
return a + b * np.cos(x)
# base figure
X,Y = coordinate(f(theta), theta)
fig, ax = plt.subplots()
# animation drawing section
artists = []
artist_prev = []
for t in thetas:
artists.append(draw_steps(ax,artist_prev, f(t), t))
artists.append(draw_finish(ax, artist_prev, X, Y))
ani = matplotlib.animation.ArtistAnimation(fig, artists, interval=500)
html = ani.to_jshtml(default_mode = 'once')
plt.close(fig)
HTML(html)
Show code cell output
解説.
極方程式
が表す曲線をリマソンまたはパスカルの蝸牛といいます。蝸牛というのは我々の耳の中にある渦巻管と呼ばれる感覚器官のことです。
さて、この一般化された極方程式はどのように変化するのでしょうか?
発展問題
先ほどの極方程式を一般化して、
で表される曲線の概形が\(a,b\)が変化するとどのように変わるか考察しなさい。さらに、\(a=b\)のときは、どのような曲線になるか答えなさい。そして、それをプログラムを実行することによって確かめなさい。
発展解説.
\(a=b\)のとき、前に見たカージオイドになります。実際、カージオイドの極方程式は
であり、リマソンの式に\(a=b\)を代入すれば、
になり、カージオイドの極方程式に一致します。
本当にこのようになっているか、この上のプログラムにおいて、\(a=b=1\)などを代入して実際に実行してみましょう。
6.4.3. 双曲螺旋#
極方程式
によって表される曲線を描きなさい。
ヒント
アルキメデスの螺旋との関係を考えてみよう。アルキメデスの螺旋では、\(\theta\)が大きくなるにつれて\(r\)も大きくなったが、今回は\(\theta\)が大きくなると\(r\)はどうなるかな……?
Show code cell source
a = 1
# 描画の細かさ
stp = 0.2
p = 1
# drawing range settings
min_range = np.pi / 3 if p > 0 else 0
max_range = 8 * np.pi if p > 0 else 6 * np.pi
stp_line = 0.00001
theta = np.arange(min_range, 2 * max_range, stp_line)
thetas = np.arange(min_range, max_range, stp)
def f(x):
# to prevent from dividing with 0
return a / (x ** p) if p > 0 else a * (x ** abs(p))
# base figure
X,Y = coordinate(f(theta), theta)
fig, ax = plt.subplots()
# animation drawing section
artists = []
artist_prev = []
for t in thetas:
artists.append(draw_steps(ax,artist_prev, f(t), t))
artists.append(draw_finish(ax, artist_prev, X, Y))
ani = matplotlib.animation.ArtistAnimation(fig, artists, interval=500)
html = ani.to_jshtml(default_mode = 'once')
plt.close(fig)
ani.save('hyp_cycle.gif')
HTML(html)
Show code cell output
解説.
極方程式
によって表される曲線を は双曲螺旋です。ここで重要なのは、\(\theta\)が小さい方から徐々に大きくなる時の、点の動きです。点は螺旋の外から内に向かって進みます。
逆に、\(\theta\)が分子に来るものはアルキメデスの螺旋でした。アルキメデスの螺旋では、\(\theta\)が大きくなるにつれて\(r\)は小さくなりました。この双曲螺旋では逆に、\(\theta\)が大きくなると\(r\)は小さくなります。
アルキメデスの螺旋\(\to\) \(\theta\)が大きくなると、\(r\)も大きくなる\(\Rightarrow\)内から外へ巻く
双曲螺旋\(\to\) \(\theta\)が大きくなると\(r\)は小さくなる\(\Rightarrow\)外から内へ巻く
発展問題
極方程式
を\(a=1\)などのときに、どのような形になるか考察し、以下のコードを実行して確かめなさい。
さらに発展的に、
がどのような形になるか、こちらも\(a=1\)などの時について考察し、同様にコードを実行して確かめなさい。ただし、ここで\(p\)は有理数とする。
ヒント
まず、\(\frac{1}{\sqrt{\theta}}=\theta ^{-\frac{1}{2}}\)でした。\(r = \frac{a}{\sqrt{\theta}}\)は\(r = a \theta ^{-p}\)において\(p=\frac{1}{2}\)としたもの。すると、\(p\)が大きくなるにつれて\(r\)の0への収束スピードは速くなりそうでは……?
解答.
Show code cell source
a = 1
p = -1
# 描画の細かさ
stp = 0.2
# drawing range settings
min_range = np.pi / 3 if p > 0 else 0
max_range = 8 * np.pi if p > 0 else 6 * np.pi
stp_line = 0.00001
theta = np.arange(min_range, max_range, stp_line)
thetas = np.arange(min_range, max_range, stp)
def f(x):
# to prevent from dividing with 0
return a / (x ** p) if p > 0 else a * (x ** abs(p))
# base figure
X,Y = coordinate(f(theta), theta)
fig, ax = plt.subplots()
# animation drawing section
artists = []
artist_prev = []
for t in thetas:
artists.append(draw_steps(ax,artist_prev, f(t), t))
artists.append(draw_finish(ax, artist_prev, X, Y))
ani = matplotlib.animation.ArtistAnimation(fig, artists, interval=500)
html = ani.to_jshtml(default_mode = 'once')
plt.close(fig)
HTML(html)
Show code cell output
解説.
極方程式
この極方程式で表される曲線はリチュースと呼ばれます。 これは先ほど見た双曲螺旋の分母に\(\sqrt{\cdot}\)をとったものです。
先ほどの双曲螺旋よりも、原点に近づいてゆくスピードが遅いことがわかります。これは分母に\(\sqrt{\cdot}\)がついたことで、\(\sqrt{\theta}\)が増加しづらくなった、つまり全体としては\( \frac{a}{\sqrt{\theta}}\)は減少しづらくなった、ということを表しています。
つまり、
\(p\)の値が大きいほど、原点に近づくスピードが速い
\(p\)の値が小さいほど、原点に近づくスピードが遅い
\(p\)が有理数ならなんでも良いわけで、仮にこれが負の有理数になると、アルキメデスの螺旋になります。実際に\(p=-1\)を代入してプログラムを実行してみましょう。
6.4.4. 極座標への変換#
直交座標での表示が
である放物線を、極方程式に直しなさい。
ヒント
直交座標の\((x,y)\)は極座標\((r,\theta)\)を用いて表すと、
だった!これを代入すると…?
解答.
\(4y=x^2\)に極座標
を代入すると、
となる。ここで、\(r\)は恒等的に0ではないので、
を得る(尚、\(r=0\)の点もこの式に含まれる)。